package com.tms.app.tms.utils.youtu;

import org.json.JSONObject;

public class Verification {
	// appid, secretid secretkey请到http://open.youtu.qq.com/获取
	// 请正确填写把下面的APP_ID、SECRET_ID和SECRET_KEY
	public static final String APP_ID = "10084995";
	public static final String SECRET_ID = "AKID50g7NPHsFMlz1tGw63mHagX9XhdKCBKF";
	public static final String SECRET_KEY = "pQmsjNp1xd6KI0WoriKn1iBPOEqMgmdK";
	public static final String USER_ID = "123132";

	public static void main(String[] args) {
 			String path="D:/idcard/idcard1.jpg";
  			Verification.VerificationIdCardOcr(path, 0);
		
	}
	
	/**
	 * 	验证方法
	 * @param path  图片路径
	 * @param i	图片正反面  0 正面 1 反面
	 * @return
	 */
	public static JSONObject VerificationIdCardOcr(String path,int i){
		JSONObject respose = null;
		try {
			Youtu faceYoutu = new Youtu(APP_ID, SECRET_ID, SECRET_KEY, Youtu.API_YOUTU_END_POINT, USER_ID);
			respose = faceYoutu.IdCardOcr(path, i);
 		} catch (Exception e) {
			e.printStackTrace();
		}		
		return respose;
	}
}
